// Webpack CSS import
import 'onsenui/css/onsenui.css';
import 'onsenui/css/onsen-css-components.css';

import Vue from 'vue'
import VConsole from 'vconsole'
import VueOnsen from 'vue-onsenui'
import App from './App.vue'

Vue.config.productionTip = false

Vue.use(new VConsole())
Vue.use(VueOnsen)

// cordova test
console.log(`window.cordova: ${JSON.stringify(window.cordova)}`)
console.log(`window.ble: ${JSON.stringify(window.ble)}`)

document.addEventListener('deviceready', onDeviceReady, false)

function onDeviceReady (event) {
  console.log(`Device is Ready. ${JSON.stringify(event)}`)
  console.log(`window.ble: ${JSON.stringify(window.ble)}`)

  window.ble.scan([], 5, function (device) {
    console.log(device)
  }, function (err) {
    console.log(err)
  })
}

new Vue({
  render: h => h(App)
}).$mount('#app')
